<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>2.13</title>
</head>
<body>
    <script>
        $("#submit").click(function (e) {
            e.preventDefault();
            var today = new Date();
            var name = $("#name").val();
            var price = $("#price").val();
            var amount = $("#amount").val();
            var str = `<div class="card">
                <div class="card-body">
                    <h5 class="card-title">
                        ${today.getFullYear()}年${
                            today.getMonth() + 1
                        }月${today.getDate()}日
                    </h5>
                <p class="card-text">物资：${name}，单价：${price}元，数量：${amount}个</p>
                <p class="card-text">共计${price*amount}元</p>
                    </div>
                </div>`;
            $("#history-list").prepend($(str));
            $("form")[0].reset();
        });
    </script>
</body>
</html>